<?php
class creep
{
	public $level;
	public $life;
        public $type;
        public $name;
        public $worth;
        public $speed;

	function __construct(){
                self::setLevel();
		self::setLife();
		self::setType();
                self::setName();
		self::setWorth();
		self::setSpeed();
	}


	public function create($level = 30, $life = 30, $type = 30, $name = "stdname", $worth = 30, $speed = 30)
	{
		$this->level		= $level;
		$this->life		= $life;
		$this->type		= $type;
                $this->name             = $name;
		$this->worth		= $worth;
		$this->speed		= $speed;
	}

	/**********************/
	/** ATTRIBUTE SETZEN **/
	/**********************/

        //Rasse setzen
        public function setType(){
            $this->type = "1";
        }

	//Leben berechnen
	public function setLife(){
            $this->life = $this->level*10;
	}

	/************************/
	/** ATTRIBUTE BEKOMMEN **/
	/************************/

	public function getLevel(){
		return $this->level;
	}

	public function getLife(){
		return $this->life;
	}

	public function getType(){
		return $this->type;
	}

	public function getName(){
		return $this->name;
	}

	public function getWorth(){
		return $this->worth;
	}

	public function getLife(){
		return $this->speed;
	}
}
echo "<code>";
//$level = 30, $life = 30, $type = 30, $name = "stdname", $worth = 30, $speed = 30
    $oCreep = new creep(30, 30, 1, "Creep1", 30, 30);
echo "</code>";